package com.dk.service.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dk.mapper.SeriesMapper;
import com.dk.pojo.Tbseries;
import com.dk.service.SeriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class seriesServiceimpl implements SeriesService {
    @Autowired
    private SeriesMapper seriesMapper;

    //第一级联动 根据品牌id查询系列id
    @Override
    public List<Tbseries> getseries(String id) {
        /*java8新特性 方法的引用*/
        LambdaQueryWrapper<Tbseries> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<Tbseries> eq = lambdaQueryWrapper.eq(!StringUtils.isEmpty(id),Tbseries:: getBrandId, id);
        List<Tbseries> tbseries = seriesMapper.selectList(eq);
        return tbseries;
    }
}
